import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/http/http.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standing_book/interrupt_record_entity.dart';

class InterruptRecordPageController extends GetxController {

  /// 请求参数
  Map<String, dynamic> queryParameters = {};
  ///获取作业中断记录相应数据
  List<InterruptRecordEntity> data = [];
  @override
  void onReady() {
    super.onReady();
    ///获取作业中断记录
    getInterruptRecord();
  }

  getInterruptRecord() async {
    queryParameters['ticketReceiptId'] = Get.arguments ;//5a8a0b2a-782d-452c-99bc-3d16b86ecd94
    final res = await HttpUtil()
        .generateGetRequest<List<InterruptRecordEntity>>(
          Interface.getInterruptRecord,
          queryParameters: queryParameters,
        )
        .execute();
    res.onSuccess((result) {
      if (result.data != null) {
        data = result.data!;
      }
    });
  }
}
